-
Notifications
You must be signed in to change notification settings - Fork 14.7k
[KeyInstr] Remove LLVM_EXPERIMENTAL_KEY_INSTRUCTIONS CMake flag #152735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[KeyInstr] Remove LLVM_EXPERIMENTAL_KEY_INSTRUCTIONS CMake flag #152735
Conversation
The CMake flag has been on by default for a month without any issues. This makes the feature support in LLVM unconditional (but does not enable the feature by default).
@llvm/pr-subscribers-llvm-ir @llvm/pr-subscribers-clang Author: Orlando Cazalet-Hyams (OCHyams) ChangesThe CMake flag has been on by default for a month without any issues. This makes the feature support in LLVM unconditional (but does not enable the feature by default). Full diff: https://github.com/llvm/llvm-project/pull/152735.diff 18 Files Affected:
diff --git a/clang/test/CMakeLists.txt b/clang/test/CMakeLists.txt
index 286c9d40d2dab..e9f4f83f98923 100644
--- a/clang/test/CMakeLists.txt
+++ b/clang/test/CMakeLists.txt
@@ -26,7 +26,6 @@ llvm_canonicalize_cmake_booleans(
PPC_LINUX_DEFAULT_IEEELONGDOUBLE
LLVM_TOOL_LLVM_DRIVER_BUILD
LLVM_INCLUDE_SPIRV_TOOLS_TESTS
- LLVM_EXPERIMENTAL_KEY_INSTRUCTIONS
)
# Run tests requiring Z3 headers only if LLVM was built with Z3
diff --git a/clang/test/DebugInfo/KeyInstructions/lit.local.cfg b/clang/test/DebugInfo/KeyInstructions/lit.local.cfg
deleted file mode 100644
index 482bd5c8ac251..0000000000000
--- a/clang/test/DebugInfo/KeyInstructions/lit.local.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-if not config.has_key_instructions:
- config.unsupported = True
diff --git a/clang/test/lit.site.cfg.py.in b/clang/test/lit.site.cfg.py.in
index 176cf644badcc..f50953a93a412 100644
--- a/clang/test/lit.site.cfg.py.in
+++ b/clang/test/lit.site.cfg.py.in
@@ -46,7 +46,6 @@ config.ppc_linux_default_ieeelongdouble = @PPC_LINUX_DEFAULT_IEEELONGDOUBLE@
config.have_llvm_driver = @LLVM_TOOL_LLVM_DRIVER_BUILD@
config.spirv_tools_tests = @LLVM_INCLUDE_SPIRV_TOOLS_TESTS@
config.substitutions.append(("%llvm-version-major", "@LLVM_VERSION_MAJOR@"))
-config.has_key_instructions = @LLVM_EXPERIMENTAL_KEY_INSTRUCTIONS@
import lit.llvm
lit.llvm.initialize(lit_config, config)
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index e9a6faa37c36b..b672cb9365284 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -588,9 +588,6 @@ set(LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING "DISABLED" CACHE STRING
"Enhance Debugify's line number coverage tracking; enabling this is ABI-breaking. Can be DISABLED, COVERAGE, or COVERAGE_AND_ORIGIN.")
set_property(CACHE LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING PROPERTY STRINGS DISABLED COVERAGE COVERAGE_AND_ORIGIN)
-option(LLVM_EXPERIMENTAL_KEY_INSTRUCTIONS
- "Add additional fields to DILocations to support Key Instructions" ON)
-
set(WINDOWS_PREFER_FORWARD_SLASH_DEFAULT OFF)
if (MINGW)
# Cygwin doesn't identify itself as Windows, and thus gets path::Style::posix
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index c126b0d073322..91aaeb5a6e3ff 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -212,10 +212,6 @@ endif()
# LLVM_ENABLE_DEBUGLOC_TRACKING_COVERAGE (non-cached) is expected to be
# 1 or 0 here, assuming referenced in #cmakedefine01.
-if(LLVM_EXPERIMENTAL_KEY_INSTRUCTIONS)
- add_compile_definitions(EXPERIMENTAL_KEY_INSTRUCTIONS)
-endif()
-
if( LLVM_REVERSE_ITERATION )
set( LLVM_ENABLE_REVERSE_ITERATION 1 )
endif()
diff --git a/llvm/include/llvm/IR/DebugInfoMetadata.h b/llvm/include/llvm/IR/DebugInfoMetadata.h
index f1f0c18949c35..98745abc4a53a 100644
--- a/llvm/include/llvm/IR/DebugInfoMetadata.h
+++ b/llvm/include/llvm/IR/DebugInfoMetadata.h
@@ -2506,10 +2506,8 @@ class DISubprogram : public DILocalScope {
class DILocation : public MDNode {
friend class LLVMContextImpl;
friend class MDNode;
-#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
uint64_t AtomGroup : 61;
uint64_t AtomRank : 3;
-#endif
DILocation(LLVMContext &C, StorageType Storage, unsigned Line,
unsigned Column, uint64_t AtomGroup, uint8_t AtomRank,
@@ -2540,18 +2538,10 @@ class DILocation : public MDNode {
public:
uint64_t getAtomGroup() const {
-#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
return AtomGroup;
-#else
- return 0;
-#endif
}
uint8_t getAtomRank() const {
-#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
return AtomRank;
-#else
- return 0;
-#endif
}
const DILocation *getWithoutAtom() const {
diff --git a/llvm/lib/IR/DebugInfoMetadata.cpp b/llvm/lib/IR/DebugInfoMetadata.cpp
index f1d4549ba015b..96065edca9b51 100644
--- a/llvm/lib/IR/DebugInfoMetadata.cpp
+++ b/llvm/lib/IR/DebugInfoMetadata.cpp
@@ -57,15 +57,9 @@ DebugVariable::DebugVariable(const DbgVariableRecord *DVR)
DILocation::DILocation(LLVMContext &C, StorageType Storage, unsigned Line,
unsigned Column, uint64_t AtomGroup, uint8_t AtomRank,
ArrayRef<Metadata *> MDs, bool ImplicitCode)
- : MDNode(C, DILocationKind, Storage, MDs)
-#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
- ,
- AtomGroup(AtomGroup), AtomRank(AtomRank)
-#endif
-{
-#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
+ : MDNode(C, DILocationKind, Storage, MDs), AtomGroup(AtomGroup),
+ AtomRank(AtomRank) {
assert(AtomRank <= 7 && "AtomRank number should fit in 3 bits");
-#endif
if (AtomGroup)
C.updateDILocationAtomGroupWaterline(AtomGroup + 1);
diff --git a/llvm/lib/IR/LLVMContextImpl.h b/llvm/lib/IR/LLVMContextImpl.h
index aa2a60e5038a7..5229843cb5215 100644
--- a/llvm/lib/IR/LLVMContextImpl.h
+++ b/llvm/lib/IR/LLVMContextImpl.h
@@ -312,10 +312,8 @@ template <> struct MDNodeKeyImpl<MDTuple> : MDNodeOpsKey {
template <> struct MDNodeKeyImpl<DILocation> {
Metadata *Scope;
Metadata *InlinedAt;
-#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
uint64_t AtomGroup : 61;
uint64_t AtomRank : 3;
-#endif
unsigned Line;
uint16_t Column;
bool ImplicitCode;
@@ -323,18 +321,13 @@ template <> struct MDNodeKeyImpl<DILocation> {
MDNodeKeyImpl(unsigned Line, uint16_t Column, Metadata *Scope,
Metadata *InlinedAt, bool ImplicitCode, uint64_t AtomGroup,
uint8_t AtomRank)
- : Scope(Scope), InlinedAt(InlinedAt),
-#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
- AtomGroup(AtomGroup), AtomRank(AtomRank),
-#endif
- Line(Line), Column(Column), ImplicitCode(ImplicitCode) {
- }
+ : Scope(Scope), InlinedAt(InlinedAt), AtomGroup(AtomGroup),
+ AtomRank(AtomRank), Line(Line), Column(Column),
+ ImplicitCode(ImplicitCode) {}
MDNodeKeyImpl(const DILocation *L)
: Scope(L->getRawScope()), InlinedAt(L->getRawInlinedAt()),
-#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
AtomGroup(L->getAtomGroup()), AtomRank(L->getAtomRank()),
-#endif
Line(L->getLine()), Column(L->getColumn()),
ImplicitCode(L->isImplicitCode()) {
}
@@ -343,16 +336,11 @@ template <> struct MDNodeKeyImpl<DILocation> {
return Line == RHS->getLine() && Column == RHS->getColumn() &&
Scope == RHS->getRawScope() && InlinedAt == RHS->getRawInlinedAt() &&
ImplicitCode == RHS->isImplicitCode()
-#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
&& AtomGroup == RHS->getAtomGroup() &&
AtomRank == RHS->getAtomRank();
-#else
- ;
-#endif
}
unsigned getHashValue() const {
-#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
// Hashing AtomGroup and AtomRank substantially impacts performance whether
// Key Instructions is enabled or not. We can't detect whether it's enabled
// here cheaply; avoiding hashing zero values is a good approximation. This
@@ -363,7 +351,6 @@ template <> struct MDNodeKeyImpl<DILocation> {
if (AtomGroup || AtomRank)
return hash_combine(Line, Column, Scope, InlinedAt, ImplicitCode,
AtomGroup, (uint8_t)AtomRank);
-#endif
return hash_combine(Line, Column, Scope, InlinedAt, ImplicitCode);
}
};
diff --git a/llvm/test/CMakeLists.txt b/llvm/test/CMakeLists.txt
index 3042b8f8d280e..b46f4829605a1 100644
--- a/llvm/test/CMakeLists.txt
+++ b/llvm/test/CMakeLists.txt
@@ -30,7 +30,6 @@ llvm_canonicalize_cmake_booleans(
LLVM_INCLUDE_SPIRV_TOOLS_TESTS
LLVM_APPEND_VC_REV
LLVM_HAS_LOGF128
- LLVM_EXPERIMENTAL_KEY_INSTRUCTIONS
)
configure_lit_site_cfg(
diff --git a/llvm/test/DebugInfo/KeyInstructions/debugify.ll b/llvm/test/DebugInfo/KeyInstructions/debugify.ll
index 551ae2794c2f3..d3be5131bec4a 100644
--- a/llvm/test/DebugInfo/KeyInstructions/debugify.ll
+++ b/llvm/test/DebugInfo/KeyInstructions/debugify.ll
@@ -1,10 +1,7 @@
; RUN: opt -passes=debugify --debugify-atoms -S -o - < %s \
; RUN: | FileCheck %s
-;; Mirrors llvm/test/DebugInfo/debugify.ll. Split out here because the
-;; test is only supported if LLVM_EXPERIMENTAL_KEY_INSTRUCTIONS is enabled
-;; (which is a condition for running this test directory). Once the conditional
-;; compilation of the feature is removed this can be merged into the original.
+;; Mirrors llvm/test/DebugInfo/debugify.ll
; CHECK-LABEL: define void @foo
define void @foo() {
diff --git a/llvm/test/DebugInfo/KeyInstructions/lit.local.cfg b/llvm/test/DebugInfo/KeyInstructions/lit.local.cfg
deleted file mode 100644
index 482bd5c8ac251..0000000000000
--- a/llvm/test/DebugInfo/KeyInstructions/lit.local.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-if not config.has_key_instructions:
- config.unsupported = True
diff --git a/llvm/test/lit.site.cfg.py.in b/llvm/test/lit.site.cfg.py.in
index 893e2cbd4f62b..973e0ec934a52 100644
--- a/llvm/test/lit.site.cfg.py.in
+++ b/llvm/test/lit.site.cfg.py.in
@@ -66,7 +66,6 @@ config.spirv_tools_tests = @LLVM_INCLUDE_SPIRV_TOOLS_TESTS@
config.have_vc_rev = @LLVM_APPEND_VC_REV@
config.force_vc_rev = "@LLVM_FORCE_VC_REVISION@"
config.has_logf128 = @LLVM_HAS_LOGF128@
-config.has_key_instructions = @LLVM_EXPERIMENTAL_KEY_INSTRUCTIONS@
import lit.llvm
lit.llvm.initialize(lit_config, config)
diff --git a/llvm/unittests/IR/BasicBlockDbgInfoTest.cpp b/llvm/unittests/IR/BasicBlockDbgInfoTest.cpp
index aac0f96845f2f..7780bbaf66f4f 100644
--- a/llvm/unittests/IR/BasicBlockDbgInfoTest.cpp
+++ b/llvm/unittests/IR/BasicBlockDbgInfoTest.cpp
@@ -189,11 +189,7 @@ TEST(BasicBlockDbgInfoTest, DropSourceAtomOnSplit) {
ASSERT_TRUE(After);
const DebugLoc &OrigTerminatorDL = After->getTerminator()->getDebugLoc();
ASSERT_TRUE(OrigTerminatorDL);
-#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
EXPECT_EQ(OrigTerminatorDL->getAtomGroup(), 1u);
-#else
- EXPECT_EQ(OrigTerminatorDL->getAtomGroup(), 0u);
-#endif
}
// Test splitBasicBlock.
@@ -204,11 +200,7 @@ TEST(BasicBlockDbgInfoTest, DropSourceAtomOnSplit) {
const DebugLoc &OrigTerminatorDL = After->getTerminator()->getDebugLoc();
ASSERT_TRUE(OrigTerminatorDL);
-#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
EXPECT_EQ(OrigTerminatorDL->getAtomGroup(), 1u);
-#else
- EXPECT_EQ(OrigTerminatorDL->getAtomGroup(), 0u);
-#endif
BasicBlock *Before = After->getSinglePredecessor();
ASSERT_TRUE(Before);
diff --git a/llvm/unittests/IR/MetadataTest.cpp b/llvm/unittests/IR/MetadataTest.cpp
index ba8367f4a396e..7425703606381 100644
--- a/llvm/unittests/IR/MetadataTest.cpp
+++ b/llvm/unittests/IR/MetadataTest.cpp
@@ -1470,17 +1470,10 @@ TEST_F(DILocationTest, Merge) {
PickMergedSourceLocations = false;
}
-#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
#define EXPECT_ATOM(Loc, Group, Rank) \
EXPECT_EQ(Group, M->getAtomGroup()); \
EXPECT_EQ(Rank, M->getAtomRank());
-#else
-#define EXPECT_ATOM(Loc, Group, Rank) \
- EXPECT_EQ(0u, M->getAtomGroup()); \
- EXPECT_EQ(0u, M->getAtomRank()); \
- (void)Group; \
- (void)Rank;
-#endif
+
// Identical, including source atom numbers.
{
auto *A = DILocation::get(Context, 2, 7, N, nullptr, false, /*AtomGroup*/ 1,
@@ -1753,15 +1746,8 @@ TEST_F(DILocationTest, KeyInstructions) {
EXPECT_EQ(Context.pImpl->NextAtomGroup, 1u);
DILocation *A1 =
DILocation::get(Context, 1, 0, getSubprogram(), nullptr, false, 1, 2);
- // The group is only applied to the DILocation if we've built LLVM with
- // EXPERIMENTAL_KEY_INSTRUCTIONS.
-#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
EXPECT_EQ(A1->getAtomGroup(), 1u);
EXPECT_EQ(A1->getAtomRank(), 2u);
-#else
- EXPECT_EQ(A1->getAtomGroup(), 0u);
- EXPECT_EQ(A1->getAtomRank(), 0u);
-#endif
// Group number 1 has been "used" so next available is 2.
EXPECT_EQ(Context.pImpl->NextAtomGroup, 2u);
diff --git a/llvm/unittests/Transforms/Utils/CloningTest.cpp b/llvm/unittests/Transforms/Utils/CloningTest.cpp
index b8b035751637a..fe81986aee7b9 100644
--- a/llvm/unittests/Transforms/Utils/CloningTest.cpp
+++ b/llvm/unittests/Transforms/Utils/CloningTest.cpp
@@ -1203,13 +1203,9 @@ TEST_F(CloneInstruction, cloneKeyInstructions) {
ASSERT_FALSE(verifyModule(*M, &errs()));
-#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
#define EXPECT_ATOM(Inst, G) \
EXPECT_TRUE(Inst->getDebugLoc()); \
EXPECT_EQ(Inst->getDebugLoc()->getAtomGroup(), uint64_t(G));
-#else
-#define EXPECT_ATOM(Inst, G) (void)Inst;
-#endif
Function *F = M->getFunction("test");
BasicBlock *BB = &*F->begin();
diff --git a/llvm/utils/gn/secondary/clang/test/BUILD.gn b/llvm/utils/gn/secondary/clang/test/BUILD.gn
index ed68387321d53..020e35e2fd467 100644
--- a/llvm/utils/gn/secondary/clang/test/BUILD.gn
+++ b/llvm/utils/gn/secondary/clang/test/BUILD.gn
@@ -60,7 +60,6 @@ write_lit_config("lit_site_cfg") {
"CLANG_VENDOR_UTI=org.llvm.clang",
"ENABLE_BACKTRACES=1",
"ENABLE_SHARED=0",
- "LLVM_EXPERIMENTAL_KEY_INSTRUCTIONS=0",
"LLVM_EXTERNAL_LIT=",
"LLVM_HOST_TRIPLE=$llvm_current_triple",
"LLVM_INCLUDE_SPIRV_TOOLS_TESTS=0",
diff --git a/llvm/utils/gn/secondary/llvm/test/BUILD.gn b/llvm/utils/gn/secondary/llvm/test/BUILD.gn
index 08cddc1f90415..aaac823157826 100644
--- a/llvm/utils/gn/secondary/llvm/test/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/test/BUILD.gn
@@ -65,7 +65,6 @@ write_lit_config("lit_site_cfg") {
"LLVM_ENABLE_FFI=0",
"LLVM_ENABLE_HTTPLIB=0",
"LLVM_ENABLE_PROFCHECK=0",
- "LLVM_EXPERIMENTAL_KEY_INSTRUCTIONS=0",
"LLVM_FORCE_VC_REVISION=",
"LLVM_HAS_LOGF128=0",
"LLVM_HAVE_OPT_VIEWER_MODULES=0",
diff --git a/utils/bazel/llvm-project-overlay/llvm/config.bzl b/utils/bazel/llvm-project-overlay/llvm/config.bzl
index 2309175d04a9b..3e9c032d5b8ce 100644
--- a/utils/bazel/llvm-project-overlay/llvm/config.bzl
+++ b/utils/bazel/llvm-project-overlay/llvm/config.bzl
@@ -113,7 +113,6 @@ llvm_config_defines = os_defines + builtin_thread_pointer + select({
"LLVM_VERSION_PATCH={}".format(LLVM_VERSION_PATCH),
r'LLVM_VERSION_STRING=\"{}\"'.format(PACKAGE_VERSION),
# Set globally in HandleLLVMOptions.cmake
- "EXPERIMENTAL_KEY_INSTRUCTIONS",
# These shouldn't be needed by the C++11 standard, but are for some
# platforms (e.g. glibc < 2.18. See
# https://sourceware.org/bugzilla/show_bug.cgi?id=15366). These are also
|
@llvm/pr-subscribers-debuginfo Author: Orlando Cazalet-Hyams (OCHyams) ChangesThe CMake flag has been on by default for a month without any issues. This makes the feature support in LLVM unconditional (but does not enable the feature by default). Full diff: https://github.com/llvm/llvm-project/pull/152735.diff 18 Files Affected:
diff --git a/clang/test/CMakeLists.txt b/clang/test/CMakeLists.txt
index 286c9d40d2dab..e9f4f83f98923 100644
--- a/clang/test/CMakeLists.txt
+++ b/clang/test/CMakeLists.txt
@@ -26,7 +26,6 @@ llvm_canonicalize_cmake_booleans(
PPC_LINUX_DEFAULT_IEEELONGDOUBLE
LLVM_TOOL_LLVM_DRIVER_BUILD
LLVM_INCLUDE_SPIRV_TOOLS_TESTS
- LLVM_EXPERIMENTAL_KEY_INSTRUCTIONS
)
# Run tests requiring Z3 headers only if LLVM was built with Z3
diff --git a/clang/test/DebugInfo/KeyInstructions/lit.local.cfg b/clang/test/DebugInfo/KeyInstructions/lit.local.cfg
deleted file mode 100644
index 482bd5c8ac251..0000000000000
--- a/clang/test/DebugInfo/KeyInstructions/lit.local.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-if not config.has_key_instructions:
- config.unsupported = True
diff --git a/clang/test/lit.site.cfg.py.in b/clang/test/lit.site.cfg.py.in
index 176cf644badcc..f50953a93a412 100644
--- a/clang/test/lit.site.cfg.py.in
+++ b/clang/test/lit.site.cfg.py.in
@@ -46,7 +46,6 @@ config.ppc_linux_default_ieeelongdouble = @PPC_LINUX_DEFAULT_IEEELONGDOUBLE@
config.have_llvm_driver = @LLVM_TOOL_LLVM_DRIVER_BUILD@
config.spirv_tools_tests = @LLVM_INCLUDE_SPIRV_TOOLS_TESTS@
config.substitutions.append(("%llvm-version-major", "@LLVM_VERSION_MAJOR@"))
-config.has_key_instructions = @LLVM_EXPERIMENTAL_KEY_INSTRUCTIONS@
import lit.llvm
lit.llvm.initialize(lit_config, config)
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index e9a6faa37c36b..b672cb9365284 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -588,9 +588,6 @@ set(LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING "DISABLED" CACHE STRING
"Enhance Debugify's line number coverage tracking; enabling this is ABI-breaking. Can be DISABLED, COVERAGE, or COVERAGE_AND_ORIGIN.")
set_property(CACHE LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING PROPERTY STRINGS DISABLED COVERAGE COVERAGE_AND_ORIGIN)
-option(LLVM_EXPERIMENTAL_KEY_INSTRUCTIONS
- "Add additional fields to DILocations to support Key Instructions" ON)
-
set(WINDOWS_PREFER_FORWARD_SLASH_DEFAULT OFF)
if (MINGW)
# Cygwin doesn't identify itself as Windows, and thus gets path::Style::posix
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index c126b0d073322..91aaeb5a6e3ff 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -212,10 +212,6 @@ endif()
# LLVM_ENABLE_DEBUGLOC_TRACKING_COVERAGE (non-cached) is expected to be
# 1 or 0 here, assuming referenced in #cmakedefine01.
-if(LLVM_EXPERIMENTAL_KEY_INSTRUCTIONS)
- add_compile_definitions(EXPERIMENTAL_KEY_INSTRUCTIONS)
-endif()
-
if( LLVM_REVERSE_ITERATION )
set( LLVM_ENABLE_REVERSE_ITERATION 1 )
endif()
diff --git a/llvm/include/llvm/IR/DebugInfoMetadata.h b/llvm/include/llvm/IR/DebugInfoMetadata.h
index f1f0c18949c35..98745abc4a53a 100644
--- a/llvm/include/llvm/IR/DebugInfoMetadata.h
+++ b/llvm/include/llvm/IR/DebugInfoMetadata.h
@@ -2506,10 +2506,8 @@ class DISubprogram : public DILocalScope {
class DILocation : public MDNode {
friend class LLVMContextImpl;
friend class MDNode;
-#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
uint64_t AtomGroup : 61;
uint64_t AtomRank : 3;
-#endif
DILocation(LLVMContext &C, StorageType Storage, unsigned Line,
unsigned Column, uint64_t AtomGroup, uint8_t AtomRank,
@@ -2540,18 +2538,10 @@ class DILocation : public MDNode {
public:
uint64_t getAtomGroup() const {
-#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
return AtomGroup;
-#else
- return 0;
-#endif
}
uint8_t getAtomRank() const {
-#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
return AtomRank;
-#else
- return 0;
-#endif
}
const DILocation *getWithoutAtom() const {
diff --git a/llvm/lib/IR/DebugInfoMetadata.cpp b/llvm/lib/IR/DebugInfoMetadata.cpp
index f1d4549ba015b..96065edca9b51 100644
--- a/llvm/lib/IR/DebugInfoMetadata.cpp
+++ b/llvm/lib/IR/DebugInfoMetadata.cpp
@@ -57,15 +57,9 @@ DebugVariable::DebugVariable(const DbgVariableRecord *DVR)
DILocation::DILocation(LLVMContext &C, StorageType Storage, unsigned Line,
unsigned Column, uint64_t AtomGroup, uint8_t AtomRank,
ArrayRef<Metadata *> MDs, bool ImplicitCode)
- : MDNode(C, DILocationKind, Storage, MDs)
-#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
- ,
- AtomGroup(AtomGroup), AtomRank(AtomRank)
-#endif
-{
-#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
+ : MDNode(C, DILocationKind, Storage, MDs), AtomGroup(AtomGroup),
+ AtomRank(AtomRank) {
assert(AtomRank <= 7 && "AtomRank number should fit in 3 bits");
-#endif
if (AtomGroup)
C.updateDILocationAtomGroupWaterline(AtomGroup + 1);
diff --git a/llvm/lib/IR/LLVMContextImpl.h b/llvm/lib/IR/LLVMContextImpl.h
index aa2a60e5038a7..5229843cb5215 100644
--- a/llvm/lib/IR/LLVMContextImpl.h
+++ b/llvm/lib/IR/LLVMContextImpl.h
@@ -312,10 +312,8 @@ template <> struct MDNodeKeyImpl<MDTuple> : MDNodeOpsKey {
template <> struct MDNodeKeyImpl<DILocation> {
Metadata *Scope;
Metadata *InlinedAt;
-#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
uint64_t AtomGroup : 61;
uint64_t AtomRank : 3;
-#endif
unsigned Line;
uint16_t Column;
bool ImplicitCode;
@@ -323,18 +321,13 @@ template <> struct MDNodeKeyImpl<DILocation> {
MDNodeKeyImpl(unsigned Line, uint16_t Column, Metadata *Scope,
Metadata *InlinedAt, bool ImplicitCode, uint64_t AtomGroup,
uint8_t AtomRank)
- : Scope(Scope), InlinedAt(InlinedAt),
-#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
- AtomGroup(AtomGroup), AtomRank(AtomRank),
-#endif
- Line(Line), Column(Column), ImplicitCode(ImplicitCode) {
- }
+ : Scope(Scope), InlinedAt(InlinedAt), AtomGroup(AtomGroup),
+ AtomRank(AtomRank), Line(Line), Column(Column),
+ ImplicitCode(ImplicitCode) {}
MDNodeKeyImpl(const DILocation *L)
: Scope(L->getRawScope()), InlinedAt(L->getRawInlinedAt()),
-#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
AtomGroup(L->getAtomGroup()), AtomRank(L->getAtomRank()),
-#endif
Line(L->getLine()), Column(L->getColumn()),
ImplicitCode(L->isImplicitCode()) {
}
@@ -343,16 +336,11 @@ template <> struct MDNodeKeyImpl<DILocation> {
return Line == RHS->getLine() && Column == RHS->getColumn() &&
Scope == RHS->getRawScope() && InlinedAt == RHS->getRawInlinedAt() &&
ImplicitCode == RHS->isImplicitCode()
-#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
&& AtomGroup == RHS->getAtomGroup() &&
AtomRank == RHS->getAtomRank();
-#else
- ;
-#endif
}
unsigned getHashValue() const {
-#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
// Hashing AtomGroup and AtomRank substantially impacts performance whether
// Key Instructions is enabled or not. We can't detect whether it's enabled
// here cheaply; avoiding hashing zero values is a good approximation. This
@@ -363,7 +351,6 @@ template <> struct MDNodeKeyImpl<DILocation> {
if (AtomGroup || AtomRank)
return hash_combine(Line, Column, Scope, InlinedAt, ImplicitCode,
AtomGroup, (uint8_t)AtomRank);
-#endif
return hash_combine(Line, Column, Scope, InlinedAt, ImplicitCode);
}
};
diff --git a/llvm/test/CMakeLists.txt b/llvm/test/CMakeLists.txt
index 3042b8f8d280e..b46f4829605a1 100644
--- a/llvm/test/CMakeLists.txt
+++ b/llvm/test/CMakeLists.txt
@@ -30,7 +30,6 @@ llvm_canonicalize_cmake_booleans(
LLVM_INCLUDE_SPIRV_TOOLS_TESTS
LLVM_APPEND_VC_REV
LLVM_HAS_LOGF128
- LLVM_EXPERIMENTAL_KEY_INSTRUCTIONS
)
configure_lit_site_cfg(
diff --git a/llvm/test/DebugInfo/KeyInstructions/debugify.ll b/llvm/test/DebugInfo/KeyInstructions/debugify.ll
index 551ae2794c2f3..d3be5131bec4a 100644
--- a/llvm/test/DebugInfo/KeyInstructions/debugify.ll
+++ b/llvm/test/DebugInfo/KeyInstructions/debugify.ll
@@ -1,10 +1,7 @@
; RUN: opt -passes=debugify --debugify-atoms -S -o - < %s \
; RUN: | FileCheck %s
-;; Mirrors llvm/test/DebugInfo/debugify.ll. Split out here because the
-;; test is only supported if LLVM_EXPERIMENTAL_KEY_INSTRUCTIONS is enabled
-;; (which is a condition for running this test directory). Once the conditional
-;; compilation of the feature is removed this can be merged into the original.
+;; Mirrors llvm/test/DebugInfo/debugify.ll
; CHECK-LABEL: define void @foo
define void @foo() {
diff --git a/llvm/test/DebugInfo/KeyInstructions/lit.local.cfg b/llvm/test/DebugInfo/KeyInstructions/lit.local.cfg
deleted file mode 100644
index 482bd5c8ac251..0000000000000
--- a/llvm/test/DebugInfo/KeyInstructions/lit.local.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-if not config.has_key_instructions:
- config.unsupported = True
diff --git a/llvm/test/lit.site.cfg.py.in b/llvm/test/lit.site.cfg.py.in
index 893e2cbd4f62b..973e0ec934a52 100644
--- a/llvm/test/lit.site.cfg.py.in
+++ b/llvm/test/lit.site.cfg.py.in
@@ -66,7 +66,6 @@ config.spirv_tools_tests = @LLVM_INCLUDE_SPIRV_TOOLS_TESTS@
config.have_vc_rev = @LLVM_APPEND_VC_REV@
config.force_vc_rev = "@LLVM_FORCE_VC_REVISION@"
config.has_logf128 = @LLVM_HAS_LOGF128@
-config.has_key_instructions = @LLVM_EXPERIMENTAL_KEY_INSTRUCTIONS@
import lit.llvm
lit.llvm.initialize(lit_config, config)
diff --git a/llvm/unittests/IR/BasicBlockDbgInfoTest.cpp b/llvm/unittests/IR/BasicBlockDbgInfoTest.cpp
index aac0f96845f2f..7780bbaf66f4f 100644
--- a/llvm/unittests/IR/BasicBlockDbgInfoTest.cpp
+++ b/llvm/unittests/IR/BasicBlockDbgInfoTest.cpp
@@ -189,11 +189,7 @@ TEST(BasicBlockDbgInfoTest, DropSourceAtomOnSplit) {
ASSERT_TRUE(After);
const DebugLoc &OrigTerminatorDL = After->getTerminator()->getDebugLoc();
ASSERT_TRUE(OrigTerminatorDL);
-#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
EXPECT_EQ(OrigTerminatorDL->getAtomGroup(), 1u);
-#else
- EXPECT_EQ(OrigTerminatorDL->getAtomGroup(), 0u);
-#endif
}
// Test splitBasicBlock.
@@ -204,11 +200,7 @@ TEST(BasicBlockDbgInfoTest, DropSourceAtomOnSplit) {
const DebugLoc &OrigTerminatorDL = After->getTerminator()->getDebugLoc();
ASSERT_TRUE(OrigTerminatorDL);
-#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
EXPECT_EQ(OrigTerminatorDL->getAtomGroup(), 1u);
-#else
- EXPECT_EQ(OrigTerminatorDL->getAtomGroup(), 0u);
-#endif
BasicBlock *Before = After->getSinglePredecessor();
ASSERT_TRUE(Before);
diff --git a/llvm/unittests/IR/MetadataTest.cpp b/llvm/unittests/IR/MetadataTest.cpp
index ba8367f4a396e..7425703606381 100644
--- a/llvm/unittests/IR/MetadataTest.cpp
+++ b/llvm/unittests/IR/MetadataTest.cpp
@@ -1470,17 +1470,10 @@ TEST_F(DILocationTest, Merge) {
PickMergedSourceLocations = false;
}
-#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
#define EXPECT_ATOM(Loc, Group, Rank) \
EXPECT_EQ(Group, M->getAtomGroup()); \
EXPECT_EQ(Rank, M->getAtomRank());
-#else
-#define EXPECT_ATOM(Loc, Group, Rank) \
- EXPECT_EQ(0u, M->getAtomGroup()); \
- EXPECT_EQ(0u, M->getAtomRank()); \
- (void)Group; \
- (void)Rank;
-#endif
+
// Identical, including source atom numbers.
{
auto *A = DILocation::get(Context, 2, 7, N, nullptr, false, /*AtomGroup*/ 1,
@@ -1753,15 +1746,8 @@ TEST_F(DILocationTest, KeyInstructions) {
EXPECT_EQ(Context.pImpl->NextAtomGroup, 1u);
DILocation *A1 =
DILocation::get(Context, 1, 0, getSubprogram(), nullptr, false, 1, 2);
- // The group is only applied to the DILocation if we've built LLVM with
- // EXPERIMENTAL_KEY_INSTRUCTIONS.
-#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
EXPECT_EQ(A1->getAtomGroup(), 1u);
EXPECT_EQ(A1->getAtomRank(), 2u);
-#else
- EXPECT_EQ(A1->getAtomGroup(), 0u);
- EXPECT_EQ(A1->getAtomRank(), 0u);
-#endif
// Group number 1 has been "used" so next available is 2.
EXPECT_EQ(Context.pImpl->NextAtomGroup, 2u);
diff --git a/llvm/unittests/Transforms/Utils/CloningTest.cpp b/llvm/unittests/Transforms/Utils/CloningTest.cpp
index b8b035751637a..fe81986aee7b9 100644
--- a/llvm/unittests/Transforms/Utils/CloningTest.cpp
+++ b/llvm/unittests/Transforms/Utils/CloningTest.cpp
@@ -1203,13 +1203,9 @@ TEST_F(CloneInstruction, cloneKeyInstructions) {
ASSERT_FALSE(verifyModule(*M, &errs()));
-#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
#define EXPECT_ATOM(Inst, G) \
EXPECT_TRUE(Inst->getDebugLoc()); \
EXPECT_EQ(Inst->getDebugLoc()->getAtomGroup(), uint64_t(G));
-#else
-#define EXPECT_ATOM(Inst, G) (void)Inst;
-#endif
Function *F = M->getFunction("test");
BasicBlock *BB = &*F->begin();
diff --git a/llvm/utils/gn/secondary/clang/test/BUILD.gn b/llvm/utils/gn/secondary/clang/test/BUILD.gn
index ed68387321d53..020e35e2fd467 100644
--- a/llvm/utils/gn/secondary/clang/test/BUILD.gn
+++ b/llvm/utils/gn/secondary/clang/test/BUILD.gn
@@ -60,7 +60,6 @@ write_lit_config("lit_site_cfg") {
"CLANG_VENDOR_UTI=org.llvm.clang",
"ENABLE_BACKTRACES=1",
"ENABLE_SHARED=0",
- "LLVM_EXPERIMENTAL_KEY_INSTRUCTIONS=0",
"LLVM_EXTERNAL_LIT=",
"LLVM_HOST_TRIPLE=$llvm_current_triple",
"LLVM_INCLUDE_SPIRV_TOOLS_TESTS=0",
diff --git a/llvm/utils/gn/secondary/llvm/test/BUILD.gn b/llvm/utils/gn/secondary/llvm/test/BUILD.gn
index 08cddc1f90415..aaac823157826 100644
--- a/llvm/utils/gn/secondary/llvm/test/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/test/BUILD.gn
@@ -65,7 +65,6 @@ write_lit_config("lit_site_cfg") {
"LLVM_ENABLE_FFI=0",
"LLVM_ENABLE_HTTPLIB=0",
"LLVM_ENABLE_PROFCHECK=0",
- "LLVM_EXPERIMENTAL_KEY_INSTRUCTIONS=0",
"LLVM_FORCE_VC_REVISION=",
"LLVM_HAS_LOGF128=0",
"LLVM_HAVE_OPT_VIEWER_MODULES=0",
diff --git a/utils/bazel/llvm-project-overlay/llvm/config.bzl b/utils/bazel/llvm-project-overlay/llvm/config.bzl
index 2309175d04a9b..3e9c032d5b8ce 100644
--- a/utils/bazel/llvm-project-overlay/llvm/config.bzl
+++ b/utils/bazel/llvm-project-overlay/llvm/config.bzl
@@ -113,7 +113,6 @@ llvm_config_defines = os_defines + builtin_thread_pointer + select({
"LLVM_VERSION_PATCH={}".format(LLVM_VERSION_PATCH),
r'LLVM_VERSION_STRING=\"{}\"'.format(PACKAGE_VERSION),
# Set globally in HandleLLVMOptions.cmake
- "EXPERIMENTAL_KEY_INSTRUCTIONS",
# These shouldn't be needed by the C++11 standard, but are for some
# platforms (e.g. glibc < 2.18. See
# https://sourceware.org/bugzilla/show_bug.cgi?id=15366). These are also
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
The CMake flag has been on by default for a month without any issues.
This makes the feature support in LLVM unconditional (but does not enable the feature by default).